package ml;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class SampleDataReader {
	private ArrayList<SampleData> m_samples = new ArrayList<SampleData>();

	private ArrayList<Double> m_prices = new ArrayList<Double>();

	public SampleDataReader(String file_name) {
		try {
			BufferedReader br = new BufferedReader(new FileReader(file_name));

			while (br.ready()) {
				SampleData a_sample = new SampleData(br.readLine());
				m_samples.add(a_sample);
				m_prices.add(a_sample.get_price());
			}

			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public ArrayList<SampleData> get_samples() {
		return m_samples;
	}

	public ArrayList<Double> get_prices() {
		return m_prices;
	}
}
